.globl GetGPIOAddress
GetGPIOAddress:
	ldr r0,=0x20200000
	mov pc, lr
.globl SetGPIOFunction
SetGPIOFunction:
	cmp r0, #53
	cmpls r1, #7
	movhi pc, lr
	push {lr}
	mov r2, r0
	bl GetGPIOAddress
 GPFSEL_Determine:
 	cmp r2, #9
 	subhi r2, #10
 	addhi r0, #4
 	bhi GPFSEL_Determine
 	add r2, r2,lsl #1
 	lsl r1, r2
 	str r1, [r0]
 	pop { pc }
 .globl SetGPIO
 SetGPIO:
 	pin .req r0
 	val .req r1
 	cmp pin, #53
 	movhi pc, lr
 	gpioAdd .req r2
 	ldr gpioAdd, =0x2020001C
 	cmp pin, #31
 	addhi gpioAdd, #4
 	cmp val, #0
 	addne gpioAdd, #12
 	mask .req r3
 	mov mask, #1
 	and pin, #31
 	lsl mask, pin
 	str mask, [gpioAdd]
 	.unreq pin
 	.unreq val
 	.unreq gpioAdd
 	.unreq mask
 	mov pc, lr
